export function echarItem(title,legend,xData,yData,datas,max,type) {
    //title---标题
    //legend---标示
    //xData----X轴
    //yData--Y轴
    //datas---数据
    //type---图表类型
    //colors---色值
    //isCursor---悬浮展示数据
    //max----最大值
    var colors = ['#1667DB', '#55CEC7',];
    let mySeries=[]
    let yd=[]
        datas.forEach((item,index) => {
            mySeries.push({
                name:legend[index],
                type:item.type?item.type:type?type:'bar',
                data:item.data?item.data:item,
                yAxisIndex:item.yAxisIndex?item.yAxisIndex:0
            })
        });
        yData.forEach((it,index) => {
            yd.push({
                type: it.type?it.type:'value',
                name: it.name?it.name:'单位：个',
                min: 0,
                max: max?max:100,
                position: it.position?it.position:'left',
                axisLine: {
                  show: true,
                  lineStyle: {
                    color: colors[0]
                  }
                },
                axisLabel: {
                  formatter: '{value}'
                },
                splitLine:{show: false},
            })
        });
    var colors = ['#1667DB', '#55CEC7',];
    return{
        title: {
          text:title,
          left:'center',
          bottom:'0',
          textStyle:{
            color:colors[0],
            fontSize:'13',
            lineHeight:'18'
          }
        },
        color: colors,
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
          }
        },
        grid: {
          right: '40',
          bottom: '40',
          left:'40',
        },
        toolbox: {
  
        },
        legend: {
          data: legend,
          top:'20',
          icon:'dotted'
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              alignWithLabel: true
            },
            data: xData
          }
        ],
        yAxis: yd,
        series:mySeries
      }
    }